package com.yzxb.erpsystem.service;

import com.yzxb.erpsystem.entity.PurchaseOrder;

import java.util.List;
import java.util.Optional;

public interface PurchaseOrderService {
    
    /**
     * 创建采购订单
     */
    PurchaseOrder createPurchaseOrder(PurchaseOrder purchaseOrder);
    
    /**
     * 更新采购订单
     */
    PurchaseOrder updatePurchaseOrder(Long id, PurchaseOrder purchaseOrder);
    
    /**
     * 删除采购订单
     */
    void deletePurchaseOrder(Long id);
    
    /**
     * 根据ID查询采购订单
     */
    Optional<PurchaseOrder> getPurchaseOrderById(Long id);
    
    /**
     * 根据订单编号查询采购订单
     */
    Optional<PurchaseOrder> getPurchaseOrderByOrderCode(String orderCode);
    
    /**
     * 查询所有采购订单
     */
    List<PurchaseOrder> getAllPurchaseOrders();
    
    /**
     * 提交采购订单
     */
    PurchaseOrder submitPurchaseOrder(Long id);
    
    /**
     * 审核采购订单
     */
    PurchaseOrder approvePurchaseOrder(Long id);
    
    /**
     * 拒绝采购订单
     */
    PurchaseOrder rejectPurchaseOrder(Long id);
    
    /**
     * 关闭采购订单
     */
    PurchaseOrder closePurchaseOrder(Long id);
}